package com.xiangge.demo1.cglib;

import org.springframework.cglib.proxy.Enhancer;

public class CglibDemo {
    public static void main(String[] args) {
        ChinesePoxy chinesePoxy = new ChinesePoxy();
        Enhancer enhancer = new Enhancer();
        enhancer.setSuperclass(Chinese.class);
        enhancer.setCallback(chinesePoxy);
        Chinese proxy = (Chinese)enhancer.create();
        proxy.sayHello();
    }
}
